package com.yunxi.module.infra.mapper.logger;

import com.yunxi.framework.mybatis.core.mapper.BaseMapperX;
import com.yunxi.module.infra.model.logger.ApiErrorLogDO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;

/**
 * <p>
 * API错误日志 Mapper
 * </p>
 *
 * @author lidy
 * @since 2024-05-17
 */
@Mapper
public interface ApiErrorLogMapper extends BaseMapperX<ApiErrorLogDO> {

    @Delete(" DELETE FROM infra_api_error_log WHERE create_time < #{createTime} limit #{limit} ")
    Integer deleteByCreateTimeLt(@Param("createTime") LocalDateTime createTime, @Param("limit") Integer limit);

}
